<?php
include_once("functions/db_manipulate.php");

if (!init()) {
    redirect("login.php");
    exit();
}

?>

    <meta charset="UTF-8">

<?php

connectDB();
startTransaction();

$delResultSet = mysql_query("DELETE FROM entergroup WHERE userid = '" . mysql_real_escape_string($_GET['uid']) . "'
                                                          AND
                                                          groupid = '" . mysql_real_escape_string($_GET['gid']) . "'") or die(mysql_error());


if ($delResultSet) {
    commitTransaction();
} else {
    rollbackTransaction();
}

redirect($_SERVER['HTTP_REFERER']);